Destructible Environments

An advantage of Relic’s system of rasterised designer-hinted maps is that it makes it easy for the game to keep up with changes in the environment. With increasingly complicated physics algorithms, game developers are under pressure to make game worlds react as realistically as possible.

One of the hot ideas at the moment is destructible environments, in which you can destroy or damage an object such as a tree or a building, with the result having an effect on the gameplay. Dawn of War 2 will feature destructible battlefields, but Jurney says that this is pretty simple.

"We keep all the maps and world representations up to date as the world changes due to construction or destruction," he explains. "So as long as the AI makes decisions often enough, they respond instantly to changes. Our AIs analyse their environments continuously (roughly every 0.5 to 1 second); as soon as the world changes, their behaviour changes to match it."

How AI in Games Works AI in Games - Destructible Environments
Crysis and Crysis Warhead both featured eminently destructible environments

A game that was particularly notable for its destructible environments was Crysis, in which you could drive a jeep through a jungle and knock down trees in front of you. Crytek’s Pavel Mores explains that the developer needed multiple ways of dealing with an environment that could change dynamically and unpredictably. He gives the example of the AI performing a path-finding search on the navigation grid as though there were no dynamic obstacles present, and then retrieving the dynamic obstacles near the resulting path and adjusting it accordingly if there was an intersection.

A rich navmesh can also help when it comes to destructible environments, and Bethesda used this in Fallout 3. The navmesh can be dynamically updated in the game when large rigid bodies are removed. This, of course, would usually use a fair amount of processing power, but Bethesda got around this by using simple square boxes to represent a rigid body on the mesh.

Bethesda’s Jean-Sylvere Simonet says that this works fine though. "In practice," he says, "most dynamic objects have a pretty square outline (cars, buses, tables and so on), so this worked out. The process is to then find out the area of the navmesh that’s overlapped by the rigid body and retesselate that area, leaving a hole along the bounding box’s outline. Then we have to recompute cover edges on the fly, but that turns out to be quick, since there are only four new edges to check. The result is that NPCs can then use these dynamic objects as cover."
Discuss this in the forums
YouTube logo
MSI MPG Velox 100R Chassis Review

October 14 2021 | 15:04

TOP STORIES

SUGGESTED FOR YOU